package icu.lookyousmileface.boot_admin.config;

import icu.lookyousmileface.boot_admin.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author starrysky
 * @title: WebConfig
 * @projectName boot_admin
 * @description: TODO
 * @date 2021/1/110:32 下午
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {
    /**
     * 添加自己定制的拦截器
     * 注意点：放行静态资源
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/","/login","/css/**","/fonts/**","/images/**","/js/**");
    }
}
